package com.firmye.codegenerator.utils;

import lombok.extern.slf4j.Slf4j;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

/**
 * @Author: ThinkPad
 * @Date: 2018/8/29 15:58
 *
 * @Description: 获取连接
 */
public class ConnectionUtil {

    public static Connection getConnection(String url,String username,String password) {
        try {
            return (Connection) DriverManager.getConnection(url, username, password);
        } catch (SQLException e) {
            e.printStackTrace();
            return null;
        }
    }

}
